
[LISCO.REC]
[Post production scheme to compile LISP into REC]
[20 December 1980]

[[]]



[many spaces are redundant]
{
    [cr, lf]			(2573TL;)&
    [read console]		(R13%='';T08%(=2080[sp,bs]TL)(@J|;L@J;);)J
    [logon message]		('
Type a LISP function using {}`s rather than ()`s, and
enclosing the whole function within *...|. End the line
with a carriage return. Use lower case. For example:

	*{car {cdr {quote {1 2 3 4 5}}}}|

Each new keystroke will show another step of compilation.
'TL@&'Initial Axiom:'TL@&@JI;:)R
    [to shorten program]	(UQzml;)U
    [write workspace]		(JZqt;)W
    [to shorten program]	(zZQml;)Z
    [signoff message]		(@&'Theorem:'TL@&JZqt;)X
				(@R(@&@WRL
JZ''E'  '@U0$S('  'E@Z1$S(
	JZD''I0$ryGI' 'I1$ryGI''I;)nL;nL)nL:
JZ''E'{ '@U0$S('{ 'E@Z1$S(
	JZD''I0$ryGI'{'I1$ryGI''I;)nL;nL)nL:
JZ''E' }'@U0$S(' }'E@Z1$S(
	JZD''I0$ryGI'}'I1$ryGI''I;)nL;nL)nL:
JZ''E'{ }'@U0$S('{ }'E@Z1$S(
	JZD''I0$ryGI'{}'I1$ryGI''I;)nL;nL)nL:
JZ' 'E@Z0$S(
	JZD''I0$ryGI''I;)nL:

[others are essential]
JZ''E'*'@U0$S('*'E'{'@U1$S('{'E@Z2$S(
	JZD''I0$ryGI''I1$ryGI' {*'I2$ryGI''I;)nL;nL)nL;nL)nL:
JZ''E'%'@U0$S('%'E'}'@U1$S('}'E@Z2$S(
	JZD''I0$ryGI''I1$ryGI'} %'I2$ryGI''I;)nL;nL)nL;nL)nL:
JZ''E'*'@U0$S('*'E@Z1$S(
	JZD'%'I0$ryGI''I1$ryGI''I;)nL;nL)nL:
JZ''E'%'@U0$S('%'E@Z1$S(
	JZD'#'I0$ryGI''I1$ryGI''I;)nL;nL)nL:

[isolate balancing parentheses]
JZ''E':{'@U0$S(':{'E'{'@U1$S('{'E'}:'@U2$S('}:'E@Z3$S(
	JZD''I0$ryGI'{'I1$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E' '@U1$S(' 'E'!'@U2$S('!'E@Z3$S(
	JZD''I0$ryGI'^'I1$ryGI'^~'I2$ryGI'!'I3$ryGI''I;)nL;nL)nL;nL)nL;nL)nL:
JZ''E'~!'@U0$S('~!'E@Z3$S(
	JZD''I0$ryGI'!'I3$ryGI''I;)nL;nL)nL:
JZ''E'~'@U0$S('~'E'!'@U1$S('!'E@Z3$S(
	JZD''I0$ryGI'^'I1$ryGI'^!'I3$ryGI''I;)nL;nL)nL;nL)nL:

[auxiliary cursors]
JZ''E'?r!'@U0$S('?r!'E@Z1$S(
	JZD''I0$ryGI''I1$ryGI''I;)nL;nL)nL:
JZ''E'?s!'@U0$S('?s!'E@Z1$S(
	JZD''I0$ryGI''I1$ryGI''I;)nL;nL)nL:
JZ''E'?r'@U0$S('?r'E' '@U1$S(' 'E'!'@U2$S('!'E@Z3$S(
	JZD''I0$ryGI'nLn'I1$ryGI'$S?r'I2$ryGI'!'I3$ryGI''I;)nL;nL)nL;nL)nL;nL)nL:
JZ''E'?s'@U0$S('?s'E' '@U1$S(' 'E'!'@U2$S('!'E@Z3$S(
	JZD''I0$ryGI''I1$ryGI'$rmml'I1$ryGI'$S?s'I2$ryGI'!'I3$ryGI''I;)nL;nL)nL;nL)nL;nL)nL:

[always be sure that EVAL gets a balanced expression]
JZ'{'E'|'@U1$S('|'E@Z2$S(
	JZD'#{'I1$ryGI'|'I2$ryGI''I;)nL;nL)nL:

[EVAL: compile the primitive LISP forms]
JZ'!{lambda 'E'!'@U1$S('!'E@Z2$S(
	JZD'!#{lambda 'I1$ryGI'!'I2$ryGI''I;)nL;nL)nL:
JZ'!!lambda {'E'}'@U1$S('}'E'!'@U2$S('!'E'!'@U3$S('!'E'|'@U4$S('|'E@Z5$S(
	JZD''I4$ryGI'{? ?r'I1$ryGI' !}'I2$ryGI'{? ?s'I1$ryGI' !}'I3$ryGI'|'I5$ryGI''I;)nL;nL)nL;nL)nL;nL)nL;nL)nL:
JZ'!car 'E'!'@U1$S('!'E'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